<?php
session_start();
if(isset($_SESSION['username'])){
    session_unset();
    session_destroy();
    echo "<script>alert('退出成功！');window.location.href = '../index.php';</script>";
}
else{
    echo "<script>alert('请先登录！');window.location.href = '../index.php';</script>";
}

